package com.itheima.day16.work;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Demo1 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class<?> aClass = Class.forName("com.itheima.day16.work.Student");
        /*Constructor<?> declaredConstructor = aClass.getDeclaredConstructor(String.class);
        declaredConstructor.setAccessible(true);
        Object dqq = declaredConstructor.newInstance("大强强");
        System.out.println(dqq);
        System.out.println(declaredConstructor);*/
        Constructor<?> declaredConstructor = aClass.getDeclaredConstructor(String.class, int.class,String.class);
        Object dada = declaredConstructor.newInstance("大强大强", 98,"qerqt");
        System.out.println(dada);
    }
}
